package com.william.lifetraxer.util;

import static com.william.lifetraxer.util.DbManager.*;
public class UserInfoDAO {
	public static int insert(UserInfo info)
	{
		String insertString = "insert into " + dbInfoTable + " (userid,gender,birthday,phone,email) value(?,?,?,?,?)" ;
		return insertUserInfo(insertString,info);
	}
	
	public static int update(UserInfo info)
	{
		String updateString = "update " + dbInfoTable + " set gender = ? , birthday = ? , phone = ? , email = ? where userid = ?" ;
		return updateUserInfo(updateString,info);
	}
	
	public static UserInfo get(String username)
	{
		String selectString = "select gender,birthday,phone,email from " + dbInfoTable + " where userid = ?";
		return getUserInfo(selectString,username);
	}
}
